package com.guimin.demo.dto;

import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.*;
import java.math.BigDecimal;

/**
 * 添加社区服务
 * @author Administrator
 */
@Accessors(chain = true)
@Data
public class AddServiceDto {
    /**
     * 父节点id，最上级节点传入0
     */
    @NotNull(message = "参数parentId不能为空")
    private Integer parentId;
    /**服务名称*/
    @NotBlank(message = "参数name不能为空")
    @Size(min = 1,max = 20)
    private String name;
    /**服务类型*/
    @NotNull(message = "参数type不能为空")
    private Integer type;
    /**参考单价*/
    @NotNull(message = "参数price不能为空")
    @Digits(integer = 9,fraction = 2,message = "分账金额格式错误")
    @DecimalMin(value = "0.00",message = "分账金额不能小于0")
    private BigDecimal price;

}
